<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
</head>
<body>
    <h2>首页</h2>
    <hr>

    {% if user %}
        当前登录的用户： {{ user.username }}
        <a href="{% url 'logout' %}">注销</a>
    {% else %}
        <a href="{% url 'login' %}">登录</a>
        <hr>
        <a href="{% url 'register' %}">注册</a>
    {% endif %}


</body>
</html>